/**$Licence:
 *   Use this however/wherever you like, just don't blame me if it breaks anything.
 *   Copyright (C) 2008 - 2013 xingsheng.zhu@gmail.com All rights reserved.
 */
package com.blazemina.robot.connector;

import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;

import com.blazemina.mina.Connector;

/**
 * @author JackChu
 * @version 1.0.0 2013-3-4 下午12:50:09
 */
public class ConnectorManager {

	private static final Queue<Connector> connectors = new LinkedBlockingQueue<Connector>();

	public static void init(int robotNum) {
		for (int i = 0; i < robotNum; i++) {
			Connector connector = new MinaConnector();
			connector.init();
			connectors.add(connector);
		}
	}
	
	/**
	 * 
	 * @return
	 */
	public static Connector getConnector(){
		return connectors.poll();
	}

}
